package com.study.forewarn.controller;

import com.study.common.core.domain.AjaxResult;
import com.study.forewarn.domain.AcademicWarning;
import com.study.forewarn.domain.CombinedWarningVO;
import com.study.forewarn.mapper.AcademicWarningRepository;
import com.study.forewarn.service.ForewarnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

// com.study.forewarn.controller.ForewarnController
@RestController
@RequestMapping("/forewarn")
public class ForewarnController {

    @Autowired
    private ForewarnService forewarnService;

    @GetMapping("/list")
    public AjaxResult getWarningList() {
        List<CombinedWarningVO> data = forewarnService.getCombinedWarningList();
        return AjaxResult.success(data);
    }
}
